<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="contitle_d"><i class="i_cart"></i> 我的购物车</div>
<div class="cart_right_box">
     <c:choose>
	   	<c:when test="${not empty resultList}">
	   		<c:set var="totalMoney" value="0"></c:set>
   		   	<div class="cart_right_top">您购物车中的商品</div>
		   	<div class="cart_right">
			   <ul>
			  	 	<c:forEach items="${resultList}" var="item">
					    <li><span>￥<fmt:formatNumber value="${item.price / 100.0}" pattern="#0.00" /></span><a target="_blank" href="mall/product/view/${item.productNo }" title="${item.productName }">${item.productName }</a></li>
					    <c:set var="totalMoney" value="${totalMoney + (item.price * item.productNum)}"></c:set>
					</c:forEach>
			   </ul>
		   	</div>
		   	<div class="cart_right_cont">共 <span class="clrb">${fn:length(resultList) }</span> 件商品<br />商品总计：<span class="f22 clrg">￥<fmt:formatNumber value="${totalMoney / 100.0}" pattern="#0.00" /></span></div>
		   	<div class="btn"><input name="" type="button" class="btng_a" value="去购物车结算" onclick="window.location.href=getRootUrl()+'mall/cart/index'" /></div>
	   	</c:when>
	   	<c:otherwise><div class="cart_right_top">您的购物车是空的</div><div class="cart_right_top">去挑选喜欢的商品吧  <a href="mall/index">挑选&gt;&gt;</a></div></c:otherwise>
	</c:choose>
</div>
